import React, { useState } from 'react'

export default function App() {
  let [phone , setPhone] = useState([{
    id : '01',
    name : '小米'
  },{
    id : '02',
    name : '华为'
  },{
    id : '03',
    name : '苹果'
  },])
  return (
    <div>
      <button onClick = {() => {setPhone([...phone,{id : Date.now(), name : '一＋'}])}}>点击添加手机</button>
      <ul>
        {
          phone.map(item => {
            return <li key={item.id}>{item.name}</li>
          })
        }
      </ul>
    </div>
  )
}
